
<template>
  <div>
    <el-table
        ref="multipleTable"
        :data="arryList"
        border
        tooltip-effect="dark"
        style="width: 100%"
        :height="property.tableHeight"
        header-cell-class-name="table-text-c"
        cell-class-name="table-text-c">
      <el-table-column
          prop="id"
          label="ID">
      </el-table-column>
      <el-table-column
          prop="title"
          label="问卷标题">
      </el-table-column>
      <el-table-column
          label="发布人">
        <template slot-scope="scope">
          <span v-if="scope.row.user">{{ scope.row.user.realname }}</span>
          <span v-else class="c-danger">无数据</span>
        </template>
      </el-table-column>
      <el-table-column
          label="审核人">
        <template slot-scope="scope">
          <span v-if="scope.row.user">{{ scope.row.examine.realname }}</span>
          <span v-else class="c-danger">无数据</span>
        </template>
      </el-table-column>
      <el-table-column
          label="问卷范围"
          width="140">
        <template slot-scope="scope">
          <span v-if="scope.row.type==0">全校</span>
          <span v-if="scope.row.type==1">特定年段(<span v-for="(item,index) in scope.row.section_id"
                                                    :key="index">{{ item.section_name }}</span>)</span>
          <span v-if="scope.row.type==2">特定班级(<span v-for="(item,index) in scope.row.class_id"
                                                    :key="index">{{ item.class_name }}</span>)</span>
        </template>
      </el-table-column>
      <el-table-column
          label="问卷人数">
        <template slot-scope="scope">
          {{ scope.row.count }}
        </template>
      </el-table-column>
      <el-table-column
          label="已反馈">
        <template slot-scope="scope">
          <!--<span @click="checkUserList(scope.$index)" class="geiUser">{{scope.row.read_number}}</span>-->
<!--          <el-button size="small" @click="detelTearch(scope.row.id)">{{ scope.row.read_number }}</el-button>-->
          {{ scope.row.read_number }}/人
        </template>
      </el-table-column>
      <el-table-column
          label="未反馈">
        <template slot-scope="scope">
          <!--<span @click="checkUserList(scope.$index)" class="geiUser">{{scope.row.count-scope.row.read_number}}</span>-->
<!--          <el-button size="small" @click="checkUserList(scope.$index)">-->
<!--            {{ scope.row.count - scope.row.read_number }}-->
<!--          </el-button>-->
          {{ scope.row.count - scope.row.read_number }}/人
        </template>
      </el-table-column>
      <el-table-column
          prop="create_time"
          label="发布时间"
          width="140">
      </el-table-column>
<!--      <el-table-column-->
<!--          label="操作"-->
<!--          width="140">-->
<!--        <template slot-scope="scope">-->
<!--          <el-button type="primary" size="small" plain>通知详情</el-button>-->
<!--        </template>-->
<!--      </el-table-column>-->
    </el-table>
  </div>
</template>

<script>
import {questionIndex} from '@/api/admin/parents_questionnaire'
export default {
  props:['property','pageindex'],
  name: "style0",
  data() {
    return {
      currentview: null, // propertytype: "companyProperty",
      // content: {
      //   label: "公司简介",
      //   body: '公司简介详细内容'
      // }
      dialogVisible: false,
      editStatus: true,
      arryList: [],
    }
  },
  watch: {
    'pageindex'(){
      this.getFileListFn()
    }
  },
  created() {
    this.getFileListFn()
  },
  methods: {
    // 获取记录
    getFileListFn() {
      console.log('收到的参数内容：', this.property)
      questionIndex({p:this.pageindex,user_id: this.property.user_id}).then(res => {
        this.arryList = res.list.data
        this.$emit('pagtotal', res.list.total)
      })
    },
    // 关闭弹窗
    closePOpup() {
      this.$emit('update:visible', false)
    },
    getJson(option) {
      return JSON.parse(JSON.stringify(option))
    }
  },
  mounted() {
  }
}
</script>

<style scoped>

</style>
